package richbar.com.richbar.activity.product;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.common.base.BaseActivity;

import butterknife.ButterKnife;
import butterknife.OnClick;
import richbar.com.richbar.R;
import richbar.com.richbar.activity.order.OrderListAc;
import richbar.com.richbar.help.TitleHelp;

/**
 * Created by QiYang on 2018/12/14.
 */

public class OrderCompleteAc extends BaseActivity {
    @Override
    public int initLayout() {
        return R.layout.ac_order_complete;
    }

    @Override
    public void initTitle() {
        new TitleHelp(this).setTitle("订单完成");
    }

    @Override
    public void initView() {
        ButterKnife.bind(this);
    }

    @Override
    public void initData() {

    }

    @OnClick({R.id.go, R.id.look_order})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.go:
                finish();
                break;
            case R.id.look_order:

                start(OrderListAc.class, new BaseActivity.OnBundleListener() {
                    @Override
                    public Bundle onSetBundle(Bundle bundle) {
                        bundle.putInt("pos", 0);
                        return bundle;
                    }
                });


                break;
        }
    }

    public static void start(Activity activity, String orderid) {
        Intent intent = new Intent(activity, OrderCompleteAc.class);
        intent.putExtra("orderid", orderid);
        activity.startActivity(intent);
    }

    /**
     * 订单id
     *
     * @return
     */
    public String getOrderid() {
        return getIntent().getStringExtra("orderid");
    }
}
